﻿<UserControl xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:os="clr-namespace:OneStop.UI" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
    xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"  
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
    mc:Ignorable="d" xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"                  
    xmlns:menu="clr-namespace:DevExpress.AgMenu;assembly=DevExpress.AgMenu.v8.2"
    xmlns:menuInternal="clr-namespace:DevExpress.AgMenu.Internal;assembly=DevExpress.AgMenu.v8.2"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"                 
    xmlns:devx="clr-namespace:DevExpress.AgDataGrid;assembly=DevExpress.AgDataGrid.v8.2"                 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"                 
    xmlns:sc="clr-namespace:SilverlightContrib.Controls;assembly=SilverlightContrib.Controls"                 
    x:Class="OneStop.UI.Page" 
    Loaded="UserControl_Loaded" d:DesignHeight="500">
    <UserControl.Resources>
    	<os:SelectedIndexBooleanConverter x:Key="SelectedIndexBooleanConverter"/>
        <os:MainProvider x:Key="Provider" />
        <os:MODFormatConverter x:Key="MODConverter" />
        <os:PercentFormatConverter x:Key="PercentConverter" />
        <os:NumericFormatConverter x:Key="NumericConverter" /> 
        <os:BooleanConverter x:Key="BoolConverter" /> 

        <Style x:Key="DeleteButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Width="16" Height="16">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>1</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Delete_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="Delete" Source="Images/delete.png" Stretch="Fill" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Image x:Name="Delete_Hot" HorizontalAlignment="Center" Margin="0" Width="16" Opacity="0" Source="Images/delete_hot.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Height="16">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="MoveUpButtonStyle" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid Width="16" Height="16">
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="FocusStates">
        							<VisualState x:Name="Focused"/>
        							<VisualState x:Name="Unfocused"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="MouseOver">
        								<Storyboard>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        									</DoubleAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        									</DoubleAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(FrameworkElement.HorizontalAlignment)">
        										<DiscreteObjectKeyFrame KeyTime="00:00:00">
        											<DiscreteObjectKeyFrame.Value>
        												<HorizontalAlignment>Center</HorizontalAlignment>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
        										<DiscreteObjectKeyFrame KeyTime="00:00:00">
        											<DiscreteObjectKeyFrame.Value>
        												<VerticalAlignment>Center</VerticalAlignment>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(FrameworkElement.Width)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(FrameworkElement.Height)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
        									</DoubleAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(FrameworkElement.HorizontalAlignment)">
        										<DiscreteObjectKeyFrame KeyTime="00:00:00">
        											<DiscreteObjectKeyFrame.Value>
        												<HorizontalAlignment>Center</HorizontalAlignment>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)">
        										<DiscreteObjectKeyFrame KeyTime="00:00:00">
        											<DiscreteObjectKeyFrame.Value>
        												<VerticalAlignment>Center</VerticalAlignment>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Disabled"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Image x:Name="image1" Source="Images/arrow_up_blue.png" Stretch="Fill"/>
        					<Image x:Name="image" Height="16" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Bottom" Width="16" Source="Images/arrow_up_hot.png" Stretch="Fill" Opacity="0"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Style x:Key="MoveDownButtonStyle" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid Width="16" Height="16">
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="FocusStates">
        							<VisualState x:Name="Focused"/>
        							<VisualState x:Name="Unfocused"/>
        						</VisualStateGroup>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="MouseOver">
        								<Storyboard>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
        									</DoubleAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(FrameworkElement.Width)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(FrameworkElement.Height)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="14"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
        									</DoubleAnimationUsingKeyFrames>
        									<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
        										<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        									</DoubleAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Disabled"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Image x:Name="image" Source="Images/arrow_down.png" Stretch="Fill"/>
        					<Image x:Name="image1" Height="16" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="16" Source="Images/arrow_down_hot.png" Stretch="Fill" Opacity="0"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>

        <Style x:Key="AddRowButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Height="24" Width="24">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>1</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="AddRow" Source="Images/table_row_new.png" Stretch="Fill" Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Image x:Name="AddRow_Hot" HorizontalAlignment="Center" Margin="0" Width="32" Opacity="0" Source="Images/table_row_new_hot.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Height="32">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="DeleteRowsButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Height="24" Width="24">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>1</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="AddRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="AddRow" Source="Images/table_delete.png" Stretch="Fill" Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Image x:Name="AddRow_Hot" HorizontalAlignment="Center" Margin="0" Width="32" Opacity="0" Source="Images/table_delete_hot.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Height="32">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <LinearGradientBrush x:Key="HeaderNormalBackgroundBrush" EndPoint="0,1" StartPoint="0,0">
    		<LinearGradientBrush.GradientStops>
    			<GradientStopCollection>
    				<GradientStop Color="#FFfefefe" Offset="0"/>
    				<GradientStop Color="#FFeff1f2" Offset="0.5"/>
    				<GradientStop Color="#FFd0d6db" Offset="1"/>
    			</GradientStopCollection>
    		</LinearGradientBrush.GradientStops>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="HeaderHoverBackgroundBrush" EndPoint="0,1" StartPoint="0,0">
    		<LinearGradientBrush.GradientStops>
    			<GradientStopCollection>
    				<GradientStop Color="#FFfefefe" Offset="0"/>
    				<GradientStop Color="#FFf4f9fc" Offset="0.35"/>
    				<GradientStop Color="#FFa9cae6" Offset="1"/>
    			</GradientStopCollection>
    		</LinearGradientBrush.GradientStops>
    	</LinearGradientBrush>
    	<LinearGradientBrush x:Key="HeaderCellGlyphBrush" EndPoint="0,1" StartPoint="0,0">
    		<LinearGradientBrush.GradientStops>
    			<GradientStopCollection>
    				<GradientStop Color="#FFa3aeb9" Offset="0"/>
    				<GradientStop Color="#FF8399a9" Offset="0.37"/>
    				<GradientStop Color="#FF718597" Offset="0.3701"/>
    				<GradientStop Color="#FF617583" Offset="1"/>
    			</GradientStopCollection>
    		</LinearGradientBrush.GradientStops>
    	</LinearGradientBrush>
    	<Style x:Key="GridColumnHeaderStyle" TargetType="dataPrimitives:DataGridColumnHeader">
    		<Setter Property="Foreground" Value="#FF000000"/>
    		<Setter Property="HorizontalContentAlignment" Value="Left"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="IsTabStop" Value="False"/>
    		<Setter Property="SeparatorBrush" Value="#FFC9CACA"/>
    		<Setter Property="Padding" Value="4"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="dataPrimitives:DataGridColumnHeader">
    					<Grid x:Name="Root">
    						<Grid.ColumnDefinitions>
    							<ColumnDefinition/>
    							<ColumnDefinition Width="Auto"/>
    						</Grid.ColumnDefinitions>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver">
    									<Storyboard>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" To="#7FFFFFFF"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" To="#CCFFFFFF"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" To="#F2FFFFFF"/>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="Pressed">
    									<Storyboard>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundRectangle" Storyboard.TargetProperty="(Fill).Color" To="#FF448DCA"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[0].Color" To="#D8FFFFFF"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" To="#C6FFFFFF"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" To="#8CFFFFFF"/>
    										<ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" To="#3FFFFFFF"/>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="SortStates">
    								<VisualState x:Name="Unsorted"/>
    								<VisualState x:Name="SortAscending">
    									<Storyboard>
    										<DoubleAnimation Duration="0" Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="SortDescending">
    									<Storyboard>
    										<DoubleAnimation Duration="0" Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="Opacity" To="1.0"/>
    										<DoubleAnimation Duration="0" Storyboard.TargetName="SortIcon" Storyboard.TargetProperty="(RenderTransform).ScaleY" To="-.9"/>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Rectangle x:Name="BackgroundRectangle" Fill="#FF1F3B53" Stretch="Fill" Grid.ColumnSpan="2"/>
    						<Rectangle x:Name="BackgroundGradient" Stretch="Fill" Grid.ColumnSpan="2">
    							<Rectangle.Fill>
    								<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    									<GradientStop Color="#FCFFFFFF" Offset="0.015"/>
    									<GradientStop Color="#F7FFFFFF" Offset="0.375"/>
    									<GradientStop Color="#E5FFFFFF" Offset="0.6"/>
    									<GradientStop Color="#D1FFFFFF" Offset="1"/>
    								</LinearGradientBrush>
    							</Rectangle.Fill>
    						</Rectangle>
    						<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition/>
    								<ColumnDefinition Width="0"/>
    							</Grid.ColumnDefinitions>
    							<ContentPresenter Content="{TemplateBinding Content}"/>
    							<Path x:Name="SortIcon" Fill="#FF444444" Stretch="Uniform" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Width="8" Opacity="0" RenderTransformOrigin=".5,.5" Grid.Column="1" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z ">
    								<Path.RenderTransform>
    									<ScaleTransform ScaleX=".9" ScaleY=".9"/>
    								</Path.RenderTransform>
    							</Path>
    						</Grid>
    						<Rectangle x:Name="VerticalSeparator" Fill="{TemplateBinding SeparatorBrush}" VerticalAlignment="Stretch" Width="1" Visibility="{TemplateBinding SeparatorVisibility}" Grid.Column="1"/>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>

        <ControlTemplate x:Key="ContentPresenterTemplate" TargetType="menuInternal:AgMenuItemContentPresenter">
            <Grid x:Name="ElementRoot">
                <Grid x:Name="ElementCheckAreaContainer">
                    <Grid x:Name="ElementCheckArea">
                        <Border Height="Auto" Margin="0,1,0,1" x:Name="ElementCheck" Width="Auto" CornerRadius="4,4,4,4" Padding="1,1,1,1">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop Color="#7FFFFFFF"/>
                                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border Height="Auto" Width="Auto" CornerRadius="3,3,3,3" Padding="1,1,1,1">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                        <GradientStop Color="#FF707070" Offset="0"/>
                                        <GradientStop Color="#FF929292" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Border Height="Auto" Width="Auto" CornerRadius="2,2,2,2" Padding="3,3,3,3">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                            <GradientStop Color="#FFBCBCBD"/>
                                            <GradientStop Color="#FFCFCFCE" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Border>
                        </Border>
                    </Grid>
                </Grid>
                <Grid x:Name="ElementIconAreaContainer">
                    <Grid x:Name="ElementIconArea">
                        <ContentControl x:Name="ElementIcon"
                                                      Content="{TemplateBinding Icon}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
                    </Grid>
                </Grid>
                <ContentControl
                                              Content="{TemplateBinding Header}"
                                              Margin="5,6,5,6"/>
                <ContentControl x:Name="ElementContent"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Margin="1,3,1,3"
                                              VerticalAlignment="Center"/>
            </Grid>
        </ControlTemplate>
        <Style x:Key="MenuTemplate" TargetType="menu:AgMenu">
            <Setter Property="Templates">
                <Setter.Value>
                    <menu:AgMenuTemplateList>
                        <menu:AgMenuTemplateListItem>
                            <menu:AgMenuTemplateListItem.Template>
                                <ControlTemplate TargetType="menu:AgMenu">
                                    <Border CornerRadius="5,5,5,5" Padding="1,1,1,1">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                <GradientStop Color="#FF929292"/>
                                                <GradientStop Color="#FFC2C2C2" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <Border Height="Auto" Width="Auto" CornerRadius="4,4,4,4" Padding="1,0,1,0">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                    <GradientStop Color="#FFDEDEDE" Offset="0"/>
                                                    <GradientStop Color="#FFF1F1F1" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <ItemsPresenter/>
                                        </Border>
                                    </Border>
                                </ControlTemplate>
                            </menu:AgMenuTemplateListItem.Template>
                        </menu:AgMenuTemplateListItem>
                    </menu:AgMenuTemplateList>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemContainerTemplates">
                <Setter.Value>
                    <menu:AgMenuTemplateList>
                        <menu:AgMenuTemplateListItem Key="AgMenuItem">
                            <menu:AgMenuTemplateListItem.Template>
                                <ControlTemplate TargetType="menu:AgMenuItem">
                                    <Grid x:Name="ElementRoot">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                                <VisualState x:Name="Hot">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" To="1"/>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" To="1"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient1" Storyboard.TargetProperty="Color" To="#7FFFFFFF"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient2" Storyboard.TargetProperty="Color" To="#00FFFFFF"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient3" Storyboard.TargetProperty="Color" To="#FF707070"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient4" Storyboard.TargetProperty="Color" To="#FF929292"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient5" Storyboard.TargetProperty="Color" To="#FFA9A9AA"/>
                                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="Gradient6" Storyboard.TargetProperty="Color" To="#FFBABAB9"/>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="DroppedDown">
                                                    <Storyboard/>
                                                </VisualState>
                                                <VisualState x:Name="DroppedDownSelected">
                                                    <Storyboard/>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <menuInternal:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
                                  CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
                                  Content="{TemplateBinding Header}"
                                  ContentTemplate="{TemplateBinding HeaderTemplate}"
                                  Header="{TemplateBinding Icon}"
                                  Template="{StaticResource ContentPresenterTemplate}">
                                            <menuInternal:AgMenuItemContentPresenter.Icon>
                                                <Border Height="Auto" Margin="0,1,0,1" x:Name="hover" Width="Auto" Padding="1,1,1,1" CornerRadius="4,4,4,4" Opacity="0">
                                                    <Border.Background>
                                                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                            <GradientStop x:Name="Gradient1" Color="#19000000"/>
                                                            <GradientStop x:Name="Gradient2" Color="#00000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Border.Background>
                                                    <Border Height="Auto" Width="Auto" CornerRadius="3,3,3,3" Padding="1,1,1,1">
                                                        <Border.Background>
                                                            <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                                <GradientStop x:Name="Gradient3" Color="#FF7E7E7E"/>
                                                                <GradientStop x:Name="Gradient4" Color="#FF9D9D9D" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Border.Background>
                                                        <Border Height="Auto" Width="Auto" CornerRadius="2,2,2,2" Padding="3,3,3,3">
                                                            <Border.Background>
                                                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                                    <GradientStop x:Name="Gradient5" Color="#FFDBDBDB"/>
                                                                    <GradientStop x:Name="Gradient6" Color="#FFF7F7F7" Offset="1"/>
                                                                </LinearGradientBrush>
                                                            </Border.Background>
                                                        </Border>
                                                    </Border>
                                                </Border>
                                            </menuInternal:AgMenuItemContentPresenter.Icon>
                                        </menuInternal:AgMenuItemContentPresenter>
                                    </Grid>
                                </ControlTemplate>
                            </menu:AgMenuTemplateListItem.Template>
                        </menu:AgMenuTemplateListItem>
                        <menu:AgMenuTemplateListItem Key="AgMenuSeparator">
                            <menu:AgMenuTemplateListItem.Template>
                                <ControlTemplate TargetType="menu:AgMenuSeparator">
                                    <Grid Height="Auto" Width="2" Margin="2,4,1,4" x:Name="separator2">
                                        <Border x:Name="separator1" Width="1" HorizontalAlignment="Left">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                    <GradientStop Color="#FF939393"/>
                                                    <GradientStop Color="#FFC1C1C1" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <Border HorizontalAlignment="Right" Width="1">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#19FDFDFD"/>
                                                    <GradientStop Color="#19FDFDFD" Offset="1"/>
                                                    <GradientStop Color="#FFFDFDFD" Offset="0.5"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                    </Grid>
                                </ControlTemplate>
                            </menu:AgMenuTemplateListItem.Template>
                        </menu:AgMenuTemplateListItem>
                    </menu:AgMenuTemplateList>
                </Setter.Value>
            </Setter>
            <Setter Property="CheckAreaDisplayMode" Value="ReplaceIcon"/>
        </Style>
        <Style x:Key="DeleteRowButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Height="24" Width="24">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="24"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>0</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Thickness>1</Thickness>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Width)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DeleteRow_Hot" Storyboard.TargetProperty="(FrameworkElement.Height)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="22"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="DeleteRow" Source="Images/table_row_delete.png" Stretch="Fill" Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Image x:Name="DeleteRow_Hot" HorizontalAlignment="Center" Margin="0" Width="32" Opacity="0" Source="Images/table_row_delete_hot.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Height="32">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">

        <sc:GroupBox Margin="8,241,0,0" Header="Profile Summary" Width="301" HorizontalAlignment="Left" Height="65" VerticalAlignment="Top">
            <Grid Margin="-3,-9,3,-5">
                <TextBlock HorizontalAlignment="Left" Margin="5,2,0,0" VerticalAlignment="Top" Text="Runtime:" TextWrapping="Wrap" FontWeight="Bold"/>
                <TextBlock x:Name="RunTime" HorizontalAlignment="Left" Margin="84,2,0,0" VerticalAlignment="Top" Text="{Binding ProfilePrimary.RunTime, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Width="35" Height="16"/>
                <TextBlock HorizontalAlignment="Left" Margin="5,17,0,0" VerticalAlignment="Top" Text="Deco Time:" TextWrapping="Wrap" d:LayoutOverrides="VerticalAlignment" FontWeight="Bold"/>
                <TextBlock x:Name="DecoTime" HorizontalAlignment="Left" Margin="84,17,0,0" VerticalAlignment="Top" Text="{Binding ProfilePrimary.DecoTime, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Width="35" Height="16" d:LayoutOverrides="VerticalAlignment"/>
                <TextBlock Margin="0,1,81,0" Text="CNS%:" TextWrapping="Wrap" Height="16" VerticalAlignment="Top" FontWeight="Bold" d:LayoutOverrides="VerticalAlignment" HorizontalAlignment="Right" />
                <TextBlock x:Name="CNS" HorizontalAlignment="Right" Margin="0,1,11,0" Text="{Binding ProfilePrimary.Model.OxTox.Cns, Converter={StaticResource PercentConverter}, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Width="35" Height="16" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment"/>
                <TextBlock HorizontalAlignment="Left" Margin="5,33,0,0" VerticalAlignment="Top" Text="GF:" TextWrapping="Wrap" FontWeight="Bold"/>
                <TextBlock HorizontalAlignment="Left" Margin="84,33,0,0" VerticalAlignment="Top" Text="{Binding ProfilePrimary.Model.Gradient.ShortName, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Height="16" Width="35"/>
                <TextBlock Margin="0,17,88,0" Text="OTUs:" TextWrapping="Wrap" Height="16" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Right" />
                <TextBlock x:Name="CNS_Copy" HorizontalAlignment="Right" Margin="0,17,11,0" Text="{Binding ProfilePrimary.Model.OxTox.Otu, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Width="35" Height="16" VerticalAlignment="Top"/>
                <TextBlock Margin="0,33,71,0" TextWrapping="Wrap" Height="16" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Right" ><Run Text="Bail Diff"/><Run Text=":"/></TextBlock>
                <TextBlock x:Name="CNS_Copy1" HorizontalAlignment="Right" Margin="0,33,11,0" Text="{Binding BailDiff, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" TextWrapping="Wrap" DataContext="{StaticResource Provider}" Width="35" Height="16" VerticalAlignment="Top"/>
            </Grid>
        </sc:GroupBox>
        
        <menu:AgMenu x:Name="menu1" Margin="8,10,6,0" Style="{StaticResource MenuTemplate}" Height="46" VerticalAlignment="Top">

            <menu:AgMenuItem x:Name="NewProfile" Tag="NewProfile" ToolTipService.ToolTip="New Profile" Click="NewProfile_Click">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/new.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuItem Tag="OpenProfile" ToolTipService.ToolTip="Open Profile">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/open.png"/>
                </menu:AgMenuItem.Icon>
                <menu:AgMenuItem x:Name="OpenProfileMenuItem">
                    <menu:AgMenuItem.Header>
                        <os:OpenProfileUserControl x:Name="OpenProfile" Width="320" Height="240" DataContext="{StaticResource Provider}"
                                                   LoadProfile="OpenProfile_LoadProfile" />
                    </menu:AgMenuItem.Header>
                </menu:AgMenuItem>
            </menu:AgMenuItem>
            <menu:AgMenuItem Tag="SaveProfile" ToolTipService.ToolTip="Save" Click="SaveProfile_Click">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/floppy_disk.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuItem x:Name="SaveAs" ToolTipService.ToolTip="Save As" Click="SaveAs_Click">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/floppy_disk_edit.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuSeparator />
            <menu:AgMenuItem Tag="RunCalc" Click="RunCalc_Click" ToolTipService.ToolTip="Run Profile">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/nav_refresh_blue.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuSeparator/>
            <menu:AgMenuItem x:Name="ViewPrimary" IsRadioItem="True" Group="ViewOutput" IsCheckable="True" ToolTipService.ToolTip="View Dive Profile" Checked="ViewPrimary_Checked" Unchecked="ViewPrimary_Checked">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/View_Dive.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuItem IsRadioItem="True" IsCheckable="True"  Group="ViewOutput" ToolTipService.ToolTip="View Bailout Profile" IsEnabled="{Binding IsCCRDive}" DataContext="{StaticResource Provider}">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/View_Bail.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuSeparator/>
            <menu:AgMenuItem Tag="Prefs" ToolTipService.ToolTip="Edit Preferences">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/preferences.png"/>
                </menu:AgMenuItem.Icon>
                <menu:AgMenuItem>
                    <menu:AgMenuItem.Header>
                        <os:PrefsUserControl Margin="14,0,0,60" VerticalAlignment="Bottom" HorizontalAlignment="Left" DataContext="{StaticResource Provider}" DefaultsSaved="PrefsUserControl_DefaultsSaved"/>
                    </menu:AgMenuItem.Header>
                </menu:AgMenuItem>
            </menu:AgMenuItem>
            <menu:AgMenuSeparator/>
            <menu:AgMenuItem Tag="FullScreen" ToolTipService.ToolTip="Fullsreen View" IsCheckable="True"
                             DataContext="{StaticResource Provider}" IsChecked="{Binding IsFullScreen, Mode=TwoWay}">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/monitor.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuItem Tag="OutOfBrowser" ToolTipService.ToolTip="Install on Desktop" Click="OutOfBrowser_Click"
                             DataContext="{StaticResource Provider}" IsEnabled="{Binding IsInstallable}">
                <menu:AgMenuItem.Icon>
                    <Image Source="Images/Toolbar/download.png"/>
                </menu:AgMenuItem.Icon>
            </menu:AgMenuItem>
            <menu:AgMenuSeparator/>
            <menu:AgMenuItem DataContext="{StaticResource Provider}">
                <menu:AgMenuItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <Grid HorizontalAlignment="Right" Margin="10,0,0,0">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="GF Dive:" FontWeight="Bold" Width="55" />
                            <TextBlock Text="{Binding Prefs.Gradient.ShortName}" Grid.Column="1" />
                            <TextBlock Text="GF Bail:" Grid.Row="1" FontWeight="Bold" />
                            <TextBlock Text="{Binding Prefs.GradientBailout.ShortName}" Grid.Column="1" Grid.Row="1" />
                        </Grid>
                        
                        <Grid HorizontalAlignment="Right" Margin="10,0,0,0">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="Name:" FontWeight="Bold" Width="55" />
                            <TextBlock Text="{Binding ProfilePrimary.Name}" Grid.Column="1" />
                        </Grid>
                    </StackPanel>                   
                </menu:AgMenuItem.Header>
            </menu:AgMenuItem>
        </menu:AgMenu>
        <Button Content="Add Gas" Click="GasEdit_Click" Margin="228,0,0,15" HorizontalAlignment="Left" Width="73" Height="22" VerticalAlignment="Bottom" />

        <sc:GroupBox Margin="313,57,8,8" Header="Output">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="10"/>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <controls:GridSplitter HorizontalAlignment="Stretch" VerticalContentAlignment="Center" Grid.Row="1" ShowsPreview="True" ToolTipService.ToolTip="Resize Split Screen" Cursor="SizeNS" IsTabStop="False" />
                <data:DataGrid x:Name="OutputGrid" DataContext="{StaticResource Provider}" ItemsSource="{Binding OutputSegments, Mode=OneWay}" AutoGenerateColumns="False" SelectionMode="Single" d:LayoutOverrides="Width">
                    <data:DataGrid.Columns>
                        <data:DataGridTextColumn Header="Segment" Binding="{Binding TypeName, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="Depth" Binding="{Binding Depth, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="Time" Binding="{Binding Time, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="Run" Binding="{Binding RunTime, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="Gas" Binding="{Binding Gas, Mode=OneWay}" Width="SizeToCells" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="PPO2" Binding="{Binding PPO2, Converter={StaticResource NumericConverter}, ConverterParameter=0.00, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="PPN2" Binding="{Binding PPN2, Converter={StaticResource NumericConverter}, ConverterParameter=0.00, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="END" Binding="{Binding END, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="FO2" Binding="{Binding InspiredFO2, Converter={StaticResource PercentConverter}, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="FHe" Binding="{Binding InspiredFHe, Converter={StaticResource PercentConverter}, Mode=OneWay}" Width="SizeToHeader" IsReadOnly="True"/>
                        <data:DataGridTextColumn Header="Flush" Binding="{Binding Flush, Converter={StaticResource NumericConverter}, ConverterParameter=0.00, Mode=OneWay}"/>
                    </data:DataGrid.Columns>
                </data:DataGrid>
                <vc:Chart x:Name="OutputChart" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    			BorderBrush="Transparent" Grid.Row="2" Theme="Theme1" >
                    <vc:Chart.AxesX>
                        <vc:Axis Title="Run Time (Minutes)" LineStyle="Dashed" Interval="1">
                            <vc:Axis.Ticks>
                                <vc:Ticks Interval="10"   />
                            </vc:Axis.Ticks>
                        </vc:Axis>
                    </vc:Chart.AxesX>
                    <vc:Chart.AxesY>
                        <vc:Axis Title="Depth" LineStyle="Dashed" ValueFormatString="#;#" />
                        <vc:Axis Title="Gradient" AxisType="Secondary" />
                    </vc:Chart.AxesY>
                </vc:Chart>
                <vc:Chart x:Name="GasChart" Grid.Row="2" BorderThickness="0" BorderBrush="{x:Null}" 
                          HorizontalAlignment="Right" Width="183" Height="190" VerticalAlignment="Bottom" 
                          Margin="0,0,22,0" Bevel="False">
                	<vc:Chart.AxesY>
                		<vc:Axis ValueFormatString="#.#"/>
                	</vc:Chart.AxesY>
                </vc:Chart>
            </Grid>
        </sc:GroupBox>    
    	<sc:GroupBox Margin="8,57,0,0" Header="Input" Height="180" VerticalAlignment="Top" HorizontalAlignment="Left" Width="301">
    		<Canvas>
                <data:DataGrid x:Name="InputGrid" Height="124" 
    				AutoGenerateColumns="False" 
    				ColumnHeaderStyle="{StaticResource GridColumnHeaderStyle}" 
    				Width="287" 
    				DataContext="{StaticResource Provider}" ItemsSource="{Binding ProfilePrimary.InputSegments, Mode=OneWay}" SelectionMode="Single">
    				<data:DataGrid.Columns>
    					<data:DataGridTextColumn Header="Depth" Binding="{Binding Depth, Mode=TwoWay, UpdateSourceTrigger=Default}" Width="45"/>
    					<data:DataGridTextColumn Header="Time" Binding="{Binding Time, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Width="40"/>
    					<data:DataGridTemplateColumn Header="Gas" Width="90">
    						<data:DataGridTemplateColumn.CellTemplate>
    							<DataTemplate>
    								<TextBlock x:Name="GasDisplay" Text="{Binding Gas}" Padding="5,5,5,5"  />
    							</DataTemplate>
    						</data:DataGridTemplateColumn.CellTemplate>
    						<data:DataGridTemplateColumn.CellEditingTemplate>
    							<DataTemplate>
    								<ComboBox x:Name="GasList" ItemsSource="{Binding ProfilePrimary.Gases, Source={StaticResource Provider}}" 
    									SelectedItem="{Binding Gas, Mode=TwoWay}" Height="26" >
    									<ComboBox.ItemTemplate>
    										<DataTemplate>
    											<StackPanel>
    												<TextBlock Text="{Binding ShortName}" />
    												<StackPanel Orientation="Horizontal">
    													<TextBlock Text="{Binding MOD14, Converter={StaticResource MODConverter}, ConverterParameter=1.4}" FontSize="10" Foreground="Blue" />
    													<TextBlock Text="; " FontSize="10" Foreground="Blue" />
    													<TextBlock Text="{Binding MOD16, Converter={StaticResource MODConverter}, ConverterParameter=1.6}" FontSize="10" Foreground="Red" />
    												</StackPanel>
    											</StackPanel>
    										</DataTemplate>
    									</ComboBox.ItemTemplate>
    								</ComboBox>
    							</DataTemplate>
    						</data:DataGridTemplateColumn.CellEditingTemplate>
    					</data:DataGridTemplateColumn>
    					<data:DataGridTextColumn Header="SetP." Binding="{Binding Setpoint, Mode=TwoWay}" Width="50"/>
    					<data:DataGridTemplateColumn Width="18">
    						<data:DataGridTemplateColumn.CellTemplate>
    							<DataTemplate>
    								<Button Style="{StaticResource DeleteButtonStyle}" x:Name="DeleteRow" Click="DeleteRow_Click" />
    							</DataTemplate>
    						</data:DataGridTemplateColumn.CellTemplate>
    					</data:DataGridTemplateColumn>
    					<data:DataGridTemplateColumn Width="18">
    						<data:DataGridTemplateColumn.CellTemplate>
    							<DataTemplate>
    								<Button Style="{StaticResource MoveUpButtonStyle}" x:Name="MoveUp" Click="MoveUp_Click" />
    							</DataTemplate>
    						</data:DataGridTemplateColumn.CellTemplate>
    					</data:DataGridTemplateColumn>
    					<data:DataGridTemplateColumn Width="18">
    						<data:DataGridTemplateColumn.CellTemplate>
    							<DataTemplate>
    								<Button Style="{StaticResource MoveDownButtonStyle}" x:Name="MoveDown" Click="MoveDown_Click" />
    							</DataTemplate>
    						</data:DataGridTemplateColumn.CellTemplate>
    					</data:DataGridTemplateColumn>
    				</data:DataGrid.Columns>
    			</data:DataGrid>
    			<Button x:Name="AddInputRow" Content="AddRow" Click="AddRow_Click" Style="{StaticResource AddRowButtonStyle}" ToolTipService.ToolTip="Add New Row" Canvas.Left="-1" Canvas.Top="128"/>
    			<CheckBox x:Name="IsOCDeco" Height="22" Width="179" Content="Auto-pick OC deco gases" Canvas.Left="128" Canvas.Top="131" />
    			<Button x:Name="DeleteInputRows" Content="AddRow" Style="{StaticResource DeleteRowsButtonStyle}" Click="DeleteRows_Click" ToolTipService.ToolTip="Clear All Rows" Canvas.Left="27" Canvas.Top="128"/>
    		</Canvas>
    	</sc:GroupBox>
    	<sc:GroupBox HorizontalAlignment="Left" Margin="8,310,0,8" Header="Gases" Width="301">
    		<Grid HorizontalAlignment="Left" Width="286">
    			<Button x:Name="AddGasRow" Content="AddRow" Click="AddGasRow_Click" Style="{StaticResource AddRowButtonStyle}" ToolTipService.ToolTip="Add New Row" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
    			<Button x:Name="DeleteGasRows" Content="AddRow" Style="{StaticResource DeleteRowsButtonStyle}" ToolTipService.ToolTip="Clear All Rows" Click="DeleteGasRows_Click" HorizontalAlignment="Left" Margin="54,0,0,0" VerticalAlignment="Bottom"/>
    			<data:DataGrid x:Name="GasList" DataContext="{StaticResource Provider}" ItemsSource="{Binding ProfilePrimary.Gases, Mode=TwoWay, UpdateSourceTrigger=Explicit}" AutoGenerateColumns="False" ColumnHeaderStyle="{StaticResource GridColumnHeaderStyle}" HorizontalAlignment="Left" Width="286" Margin="0,0,0,28">
    				<data:DataGrid.Columns>
    					<data:DataGridTextColumn Header="%O2" Binding="{Binding FO2, Converter={StaticResource PercentConverter}, Mode=TwoWay, UpdateSourceTrigger=Explicit}"/>
    					<data:DataGridTextColumn Binding="{Binding FHe, Converter={StaticResource PercentConverter}, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Header="%He"/>
    					<data:DataGridTextColumn Header="MOD14" Binding="{Binding MOD14, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" IsReadOnly="True"/>
    					<data:DataGridTextColumn Header="MOD16" Binding="{Binding MOD16, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" IsReadOnly="True"/>
    					<data:DataGridTextColumn Binding="{Binding END, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" IsReadOnly="True" Header="END"/>
    					<data:DataGridTextColumn Binding="{Binding Ceiling, Converter={StaticResource NumericConverter}, ConverterParameter=0, Mode=OneWay}" Header="Ceiling"/>
    					<data:DataGridCheckBoxColumn Header="Use" Binding="{Binding Enable, Mode=TwoWay, UpdateSourceTrigger=Explicit}"/>
    				</data:DataGrid.Columns>
    			</data:DataGrid>
    			<Button x:Name="AddGasRow_Copy" Content="AddRow" Click="AddGasRow_Click" Style="{StaticResource AddRowButtonStyle}" ToolTipService.ToolTip="Add New Row" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
    			<Button x:Name="DeleteGasRow" Content="AddRow" Click="DeleteGasRow_Click" Style="{StaticResource DeleteRowButtonStyle}" ToolTipService.ToolTip="Delete Row" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="27,0,0,0" IsEnabled="{Binding SelectedIndex, Converter={StaticResource SelectedIndexBooleanConverter}, ElementName=GasList, Mode=OneWay}"/>
    		</Grid>
    	</sc:GroupBox>    
    </Grid>
</UserControl>
